home *** CD-ROM | disk | FTP | other *** search
/ Light ROM 1 / LIGHT-ROM 1 (Amiga Library Services)(1994).iso / ffdisks / d892.lha / Indent / Projects < prev    next >
Text File  |  1993-03-10  |  4KB  |  140 lines

  1. * wishlist from tarjeij@ulrik.uio.no
  2.  
  3.    struct a {   /* Cuddling variable with declaration independent of other */
  4.       int b;    /* settings */
  5.    } c;
  6.  
  7.    if (condition)   /* Force a blank line after single statement ifs. */
  8.       whatever;     /* force single statment to begin on new line */
  9.  
  10.  
  11.    while (*c = *p)  /* Force semicolon on new line. Same with for and if */
  12.      ;              /* (Force single statement while, do, to begin statement
  13.             /* on new line) */
  14.  
  15.  
  16. * Remove support for `+' option prefix.
  17.  
  18. * Consider an option to use spaces rather than tabs in output.
  19.  
  20. * 'whitesmiths style', apparently after the examples shipped with
  21.   that firm's compiler.  It differs from the GNU style mainly in that
  22.   the statements inside braces are lined up with the braces.  E.g.:
  23.  
  24.   int main(int argc, char *argv[])
  25.       {
  26.       if (argc <= 1)
  27.       printf("No args\n");
  28.       else
  29.       {
  30.       switch (argc)
  31.           {
  32.           case 2:
  33.           printf("One arg\n");
  34.           break;
  35.           default:
  36.           printf("Lotsa args\n");
  37.           break;
  38.           }
  39.       }
  40.       return EXIT_SUCCESS;
  41.       }
  42.  
  43. * Perhaps indent could process C++ comments ("//")?  Apparently, some versions
  44.   of C use this as well.
  45.  
  46. * Someone requested an option to keep cases statments all on one line.
  47.  
  48. * Consider an option to produce "char* c" rather than  "char *c"
  49.  
  50. *  There is no way to specify that a unary & (as in address-of
  51.    operator) not preceed it's argument by a space.
  52. [rms: I agree that is a desirable mode we should support somehow.]
  53.  
  54.  
  55. *  It would be nice to have a different line length for comments than
  56.    for code.
  57. [rms: I agree that is a desirable mode we should support somehow.
  58. It should not be terribly hard.]
  59.  
  60.  
  61. *  Indent gets confused by a multiple "C" statements nested in a macro:
  62.  
  63.    This line:
  64.  
  65.     CHECK_ZERO(rpmsg->rip_res, tracef(" reserved fields not zero"); break );
  66.  
  67.    yields these errors:
  68.  
  69.     ../rip.c: 115: Unbalanced parens
  70.     ../rip.c: 115: Line broken
  71.     ../rip.c: 115: Extra )
  72.  
  73. [rms: Code like this appears in other programs too.
  74. For example, toplev.c in GCC.  So it is important not to get too upset
  75. when things like this appear in the input.]
  76.  
  77.  
  78. Add a new option specifying how goto labels are indented.
  79.  
  80. Make it so that the line numbers indent reports are the real line
  81. numbers (currently it is often off by a few).
  82.  
  83. Error recover should probably be enhanced.  At a minimum, "indent
  84. foo.c" should not overwrite foo.c when it gets an error.  Fancy error
  85. recover is probably not worth the effort because indent is pretty
  86. fast.  Stopping after the first error might be more helpful than the
  87. current error cascades.
  88.  
  89. Make the -nss option cause
  90.   while (foo)
  91.     ;
  92. This is the real alternative to 
  93.   while (foo) ;
  94.  
  95. Look at all the undocumented options, and determine which of them are
  96. bug-free enough that they should be documented.
  97.  
  98.     1) Is it possible to control how indent puts white space *within*
  99. an expression?  I notice that "(x*y<5)" comes out like "(x * y < 5)".  Can
  100. I configure "indent" to put spaces around "the following list of characters"
  101. and do not put spaces around "the following list of characters"?  I.E. Can
  102. I make it put spaces around "< > + - || &&" and *not* put spaces around
  103. "* / ^ &", etc. ?
  104.  
  105.  
  106. Consider leaving the spacing between the preprocessor
  107. # and the "if", "endif", etc. and indent that line as if it were
  108. a regular if () in C.
  109.  
  110. Thus, given
  111.  
  112. main()
  113. {
  114.     int x = 1, y = 1, z = 1;
  115.     if (x)
  116.     if (y)
  117.         if (z)
  118. #        ifdef FOO
  119.             printf("hello\n");
  120. #        else FOO
  121.             printf("world\n");
  122. #        endif FOO
  123. }
  124.  
  125.  
  126.  
  127. main()
  128. {
  129.     int             x = 1, y = 1, z = 1;
  130.     if (x)
  131.     if (y)
  132.         if (z)
  133. #               ifdef FOO
  134.             printf("hello\n");
  135. #               else    /* FOO */
  136.             printf("world\n");
  137. #               endif    /* FOO */
  138. }
  139.  
  140.